<template>
  <div class="backGround">
    <div class="title">
      <transition enter-active-class="animate__animated animate__zoomInDown">
        <div v-if="index == 0">welcome my web</div>
      </transition>
    </div>
    <a href="" class="goDown">
      <transition enter-active-class="animate__animated animate__fadeInDown" leave-active-class="animate__animated animate__fadeOut">
        <span v-if="index == 0 && flag"></span>
      </transition>
    </a>
  </div>
</template>

<script>
export default {
  name: "Welcome",
  data() {
    return {
      index: -1,
      flag :false
    };
  },
  props: ["show"],
  watch: {
    show(newVal) {
      this.index = newVal;
    },
  },
  mounted(){
    setInterval(() => {
      this.flag = !this.flag
    }, 1000);
  }
};
</script>

<style scoped>
.backGround {
  background: url(./image/background.jpg) center;
  background-size: cover;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.title {
  text-align: center;
  font-size: 100px;
  position: relative;
  top: 50%;
  transform: translateY(-50%);
  font-weight: bolder;
}
.goDown {
  position: absolute;
  left: 50%;
  bottom: 20px;
  z-index: 100;
  width: 50px;
  height: 53px;
  margin-left: -25px;
}
.goDown span {
  display: block;
  width: 50px;
  height: 53px;
  background-image: url(./image/godown.png);
}
</style>
